#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>

using namespace std;

vector<string> ret;
string path;

int l = 0, r = 0, n = 0;

void dfs()
{
    if (right == n && left == right)
    {
        ret.push_back(path);
        return;
    }

    if (left < n)
    {
        left++;
        path.push_back('(');
        dfs();
        left--;
        path.pop_back();
    }
    if (right < left)
    {
        right++;
        path.push_back(')');
        dfs();
        right--;
        path.pop_back();
    }
}

vector<string> generateParenthesis(int num) {
    n = num;
    dfs();
    return ret;
}



int main()
{
    generateParenthesis(1);
	return 0;
}